<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTreatmentPlantsTable extends Migration
{
    /**
     * Run the migrations.
     * 处理厂---硬件绑定
     *
     * @return void
     */
    public function up()
    {   
        //生活垃圾处理厂
        Schema::create('domestic_treatment_plants', function (Blueprint $table) {
            $table->increments('id');
            $table->char('imei',15)->comment('设备唯一imei')->nullable();
            $table->string('name')->comment('设备名称')->nullable();
            $table->string('address')->comment('地址')->nullable();
            $table->point('location')->comment('经纬度')->nullable();
            $table->string('temperature')->comment('炉温')->nullable();
            $table->string('incoming')->comment('来料')->nullable();
            $table->integer('gas')->comment('尾气')->nullable();
            $table->string('smell')->comment('气味')->nullable();
            $table->string('slag')->comment('炉渣')->nullable();
            $table->string('water')->comment('用水')->nullable();
            $table->string('electric')->comment('用电')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });

        //餐厨垃圾处理厂
        Schema::create('kitchen_treatment_plants', function (Blueprint $table) {
            $table->increments('id');
            $table->char('imei',15)->comment('设备唯一imei')->nullable();
            $table->string('name')->comment('设备名称')->nullable();
            $table->string('address')->comment('地址')->nullable();
            $table->point('location')->comment('经纬度')->nullable();
            $table->string('temperature')->comment('炉温')->nullable();
            $table->string('incoming')->comment('来料')->nullable();
            $table->integer('gas')->comment('尾气')->nullable();
            $table->string('smell')->comment('气味')->nullable();
            $table->string('organic_fertilizer')->comment('有机肥')->nullable();
            $table->string('sewage')->comment('污水')->nullable();
            $table->string('bio_oil')->comment('生物油')->nullable();
            $table->string('water')->comment('用水')->nullable();
            $table->string('electric')->comment('用电')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('treatment_plants');
    }
}
